using IBatisNet.Common;

using Castle.MonoRail.Framework;

using eduSrc.Models;
using eduSrc.Services;

namespace eduSrc.Web.Controllers
{
    [Filter(ExecuteEnum.BeforeAction, typeof(DomainFilter))]
    [Helper(typeof(FormatHelper))]
    [Layout("channel")]
    public abstract class BaseController : SmartController
    {
        protected readonly eduSrcCatalogService _eduSrcCatalogService = eduSrcCatalogService.GetInstance();

        protected void CreateKeywords(string columnType)
        {
            eduSrc.Models.PageMeta pm = _eduSrcCatalogService.GetPageMetaByModuleCn(columnType);

            if (pm != null)
            {
                PropertyBag["Title"] = pm.Title;
                PropertyBag["Keywords"] = pm.Keywords;
                PropertyBag["Description"] = pm.Description;
            }
        }
    }
}
